//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.loby.monitor.client.propertie;

public class ForwardInfo {
    String ip;
    int port;
    boolean enabled;
    transient int tryCount;

    public ForwardInfo() {
    }

    public ForwardInfo(String ip, int port, boolean enabled, int tryCount) {
        this.ip = ip;
        this.port = port;
        this.enabled = enabled;
        this.tryCount = 0;
    }

    public String change(ForwardInfo info) {
        return info.ip.equalsIgnoreCase(this.ip) && this.port == info.port && this.enabled != info.enabled ? this.ip + ":" + this.port + ": set to:" + info.enabled : null;
    }

    @Override
    public String toString() {
        return this.ip + ":" + this.port + ":Enable:" + this.enabled;
    }

    public void IncreaseTryCount() {
        ++this.tryCount;
    }

    public static ForwardInfo.ForwardInfoBuilder builder() {
        return new ForwardInfo.ForwardInfoBuilder();
    }

    public String getIp() {
        return this.ip;
    }

    public int getPort() {
        return this.port;
    }

    public boolean isEnabled() {
        return this.enabled;
    }

    public int getTryCount() {
        return this.tryCount;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public void setEnabled(boolean enabled) {
        this.enabled = enabled;
    }

    public void setTryCount(int tryCount) {
        this.tryCount = tryCount;
    }

    @Override
    public boolean equals(Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof ForwardInfo)) {
            return false;
        } else {
            ForwardInfo other = (ForwardInfo)o;
            if (!other.canEqual(this)) {
                return false;
            } else {
                label31: {
                    Object this$ip = this.getIp();
                    Object other$ip = other.getIp();
                    if (this$ip == null) {
                        if (other$ip == null) {
                            break label31;
                        }
                    } else if (this$ip.equals(other$ip)) {
                        break label31;
                    }

                    return false;
                }

                if (this.getPort() != other.getPort()) {
                    return false;
                } else {
                    return this.isEnabled() == other.isEnabled();
                }
            }
        }
    }

    protected boolean canEqual(Object other) {
        return other instanceof ForwardInfo;
    }

    @Override
    public int hashCode() {
        boolean PRIME = true;
        int result = 1;
        Object $ip = this.getIp();
        result = result * 59 + ($ip == null ? 43 : $ip.hashCode());
        result = result * 59 + this.getPort();
        result = result * 59 + (this.isEnabled() ? 79 : 97);
        return result;
    }

    public static class ForwardInfoBuilder {
        private String ip;
        private int port;
        private boolean enabled;
        private int tryCount;

        ForwardInfoBuilder() {
        }

        public ForwardInfo.ForwardInfoBuilder ip(String ip) {
            this.ip = ip;
            return this;
        }

        public ForwardInfo.ForwardInfoBuilder port(int port) {
            this.port = port;
            return this;
        }

        public ForwardInfo.ForwardInfoBuilder enabled(boolean enabled) {
            this.enabled = enabled;
            return this;
        }

        public ForwardInfo.ForwardInfoBuilder tryCount(int tryCount) {
            this.tryCount = tryCount;
            return this;
        }

        public ForwardInfo build() {
            return new ForwardInfo(this.ip, this.port, this.enabled, this.tryCount);
        }

        public String toString() {
            return "ForwardInfo.ForwardInfoBuilder(ip=" + this.ip + ", port=" + this.port + ", enabled=" + this.enabled + ", tryCount=" + this.tryCount + ")";
        }
    }
}
